<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Simple example</title>
</head>
<body>
<button onclick="generate()">Generate pdf</button>

<script src="libs/jspdf.min.js"></script>
<script src="../dist/jspdf.plugin.autotable.src.js"></script>

<script>
    function generate() {
        var columns = ["ID", "Name", "Age", "City"];
        var data = [
            [1, "Jonatan", 25, "Gothenburg"],
            [2, "Simon", 23, "Gothenburg"],
            [3, "Hanna", 21, "Stockholm"]
        ];

        var doc = new jsPDF('p', 'pt');
        doc.autoTable(columns, data);
        doc.save("table.pdf");
    }
</script>
</body>
</html>